<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>ShowFrameNumber / ShowSMPTE Avisynth Filter</title>
<link rel="stylesheet" type="text/css" href="../../avisynth.css">
</head>
<body >
<h2>ShowFrameNumber</h2>
<p><code>ShowFrameNumber </code>(<var>clip,
  bool   &quot;scroll&quot;,
  int    &quot;offset&quot;,
  float &quot;x&quot;,
  float &quot;y&quot;,
  string &quot;font&quot;,
  float  &quot;size&quot;,
  int    &quot;text_color&quot;,
  int    &quot;halo_color&quot;,
  float  &quot;font_width&quot;,
  float  &quot;font_angle&quot;</var>)</p>

<p><code>ShowFrameNumber</code> draws text on every frame indicating what
  number AviSynth thinks it is. This is sometimes useful when writing scripts.
  If you apply additional filters to the clip produced by <code>ShowFrameNumber</code>,
  they will treat the text on the frame just as they would treat an image, so
  the numbers may be distorted by the time you see them.</p>
<p>If <var>scroll</var> (default: false) is set to true the framenumber will
  be drawn only once on the video and scroll from top to bottom, else it will
  be drawn on the right side as often as it fits. For top field first material
  the framenumber will be drawn on the left side of the clip, for bottom field
  first material on the right side and for field-based material it will be
  drawn alternating on the left side and right side of the clip (depending
  whether the field is top or bottom).</p>
<p>Starting from v2.56 other options ..., <var>x</var>, <var>y</var>,
  <var>font</var>, <var>size</var>, <var>text_color</var>,
  <var>halo_color</var>, <var>font_width</var>, <var>font_angle</var>) are
  present, see <a href="subtitle.htm">Subtitle</a> for an explanation of these
  options.</p>
<p><var>offset</var> enables the user to add an offset to the shown
  framenumber.</p>

<h2>ShowSMPTE</h2>
<p><code>ShowSMPTE </code>(<var>clip,
  float  &quot;fps&quot;,
  string &quot;offset&quot;,
  int    &quot;offset_f&quot;,
  float &quot;x&quot;,
  float &quot;y&quot;,
  string &quot;font&quot;,
  float  &quot;size&quot;,
  int    &quot;text_color&quot;,
  int    &quot;halo_color&quot;,
  float  &quot;font_width&quot;,
  float  &quot;font_angle&quot;</var>)</p>
<p><code>ShowSMPTE</code> is similar to <code>ShowFrameNumber</code>
  but displays SMPTE timecode (hours:minutes:seconds:frame). Starting from
  v2.53 the <var>fps</var> argument is not required, unless the current fps
  can't be used. Otherwise, the <var>fps</var> argument is required and must be
  23.976, 24, 25,  29.97, or 30.</p>
<p>Starting from v2.56 other options (<var>x</var>, <var>y</var>,
  <var>font</var>, <var>size</var>, <var>text_color</var>,
  <var>halo_color</var>, <var>font_width</var>, <var>font_angle</var>) are
  present, see <a href="subtitle.htm">Subtitle</a> for an explanation of these
  options.</p>
<p><var>offset</var> enables the user to
  add an offset to the timecode, while <var>offset_f</var> enables the user to
  add an offset to the timecode specifying the number of frames
  (<var>offset</var> takes precedence over <var>offset_f</var>).</p>
<p><b>drop-frame versus non-drop-frame timecode</b>
</p>
<p>For some framerates the
  <a href="http://teched.vt.edu/gcc/HTML/VirtualTextbook/PDFs/AdobeTutorialsPDFs/Premiere/PremiereTimecode.pdf">drop-frame
  timecode</a>  is enabled. If for example the framerate of the clip is between 29.969 and 29.971
it is enabled. Originally, when the signal of the TV was black and
  white, NTSC run at 60 Hz (30 fps). When they added color, they changed it to
  59.94 Hz (29.97 fps) due to technical reasons. They run 1000 frames, but
  count 1001 (they never actually drop a frame, just a frame number). The first
  two frames are dropped of every minute except the tenth,
ie  00:00:00:00, 00:00:00:01, 00:00:00:02, ...,
	00:00:59:29, 00:01:00:02, 00:01:00:03, ...,
	00:01:59:29, 00:02:00:02, 00:02:00:03, ...,
	00:08:59:29, 00:09:00:02, 00:09:00:03, ...,
	00:09:59:29, 00:10:00:00, 00:10:00:01, etc ...
  Counting the dropped frames implies that 00:10:00:00 in drop-frame matches
  00:10:00:00 in real time.
</p>
<p>Something similar holds also for the following framerates:
</p>
<table border="1" width="50%">
  <tr>
    <td width="25%"><b>framerate range</b></td>
    <td width="25%"><b>base-rate</b></td>
  </tr>
  <tr>
    <td width="25%">[29.969, 29.971]</td>
    <td width="25%">30</td>
  </tr>
  <tr>
    <td width="25%">[47.951, 47.953]</td>
    <td width="25%">48</td>
  </tr>
  <tr>
    <td width="25%">[59.939, 59.941]</td>
    <td width="25%">60</td>
  </tr>
  <tr>
    <td width="25%">[119.879, 119.881]</td>
    <td width="25%">120</td>
  </tr>
</table>
<p><b>Examples</b>
<pre>ShowSMPTE(offset=&quot;00:00:59:29&quot;, x=360, y=576, font=&quot;georgia&quot;,
  /       size=24, text_color=$ff0000)</pre>
<pre>Mpeg2Source(&quot;clip.d2v&quot;) # is always top field first
# will draw the framenumber on the left side of the clip using
# an offset of 9 frames, scrolling from top to bottom
ShowFrameNumber(scroll=true, offset=9, text_color=$ff0000)</pre>

<h2>ShowTime</h2>
<p><code>ShowTime </code>(<var>clip,
  int    &quot;offset_f&quot;,
  float &quot;x&quot;,
  float &quot;y&quot;,
  string &quot;font&quot;,
  float  &quot;size&quot;,
  int    &quot;text_color&quot;,
  int    &quot;halo_color&quot;,
  float  &quot;font_width&quot;,
  float  &quot;font_angle&quot;</var>)</p>

<p><code>ShowTime</code> is similar to <code>ShowSMPTE</code>
  but it displays the time duration (hours:minutes:seconds.ms).
  See ShowSMPTE for an explanation of the options.</p>

<p>Take care: these filters are quite slow due to the text-drawing.
</p>
<p><b>Changes</b></p>
<table border="1">
  <tbody>
    <tr>
      <td>v2.60</td>
      <td>All functions: position (x,y) can be float (previously int) (with 0.125
        pixel granularity). ShowSMPTE: added drop-frame for other framerates (other than 30).</td>
    </tr>
    <tr>
      <td>v2.58</td>
      <td>Added ShowTime function.<br>
	      Added font_width, font_angle args.</td>
    </tr>
    <tr>
      <td>v2.56</td>
      <td>Added offset and other options.</td>
    </tr>
  </tbody>
</table>
<p><kbd>$Date: 2012/03/16 20:53:18 $</kbd></p>
<FORM>
<INPUT TYPE="Button" VALUE="Back"
onClick="history.go(-1)">
</form>
</body>
</html>
